<?php ob_start(); 
include("config/config.php");
if(isset($_REQUEST['url'])&&($_REQUEST['url']!="")){ 
	$sql=mysql_query("SELECT * FROM `my_business_url` WHERE `url` = '".$_REQUEST['url']."'")or die(mysql_error());
	$a=mysql_fetch_array($sql);
	$num=mysql_num_rows($sql);
	if($num==0){header("location:index.php"); exit;}
}else{header("location:index.php"); exit;}
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php if(!empty($a['title'])){echo $a['title'];}else{echo $a['url'];} ?> :: Mycity Dial</title>
<meta name="description" content="<?php if(!empty($a['description'])){echo substr($a['description'],0,100);}else{echo $a['url'];} ?>">
<meta name="keywords" content="<?php if(!empty($a['title'])){echo $a['title'];}else{echo $a['url'];} ?>">
<meta name="author" content="Mr.Himanshu Singh">
<meta charset="UTF-8">
<link href="css/mains.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
   <header id="header">
   <div class="head_main">
       <div class="logo"><a href="what_new.php"><img src="images/logo.png" alt="" /></a></div> 
       <div class="snetwork"><!--<img src="images/social.gif"  alt="" />-->
            <span class='st_google_bmarks_hcount' displayText='Bookmarks'></span>
            <span class='st_facebook_hcount' displayText='Facebook'></span>
            <span class='st_twitter_hcount' displayText='Tweet'></span>
       </div><a href="business_page.php">
       <div class="greenbox"> Create New Business Page </div>   </a>         
    </div> 
   </header>
<div  class="cmtop" >  
   <div class="leftblock"> 
    <h2><?php if(!empty($a['title'])){echo $a['title'];}else{echo "http://mycitydial.com/".$a['url'];} ?> </h2>
    <?php if(isset($_SESSION['id'])&&($_SESSION['id']==$a['userid'])){?>
    <a href="create_page.php?url=<?php echo $a['id']; ?>" class="edit"><img src="images/edit.gif"  /></a> 
    <?php }?>
    <div class="editor">
      <?php 
	  if(isset($_REQUEST['page'])&&($_REQUEST['page']=="gallery")){?>
            <!--Photo Gallery start-->
            <div class="photo_gallery" style="width: 700px;">
            <?php $sql=mysql_query("SELECT * FROM `my_images` WHERE `url_id` ='".$a['id']."' LIMIT 10")or die(mysql_error());
            while($row=mysql_fetch_array($sql)){
            ?>
            <section class='photo_section'>
            <div class='photo_main'><img src='uploads/<?php echo $row['image']; ?>' height='172' width='138'  ></div>
            </section>
            <?php }?>
            </div>
            <!--Photo  Gallery end-->
      <?php }else if(isset($_REQUEST['page'])&&($_REQUEST['page']=="artical")){?>
		<h2><?php if(!empty($a['article_title'])){echo $a['article_title'];} ?></h2> <br clear="all" /> 
        <?php if(!empty($a['article_discription'])){echo $a['article_discription'];} ?>
	 <?php }else{
				echo "<iframe src='".$a['page_url']."' height='".$a['page_height']."' width='750' scrolling='no'></iframe>";
	       }	 
	 ?>
    </div>  
   </div>
   
   
 <div class="rightblock">
 <?php  if(isset($a['userid'])){ $user=get_allitem('my_user','id',$a['userid']);}?>
<p><strong><?php echo $user['fname']." ".$user['lname']; ?></strong><br />
<?php if(!empty($a['description'])){echo substr($a['description'],0,200);} ?>
</p>
<br  />
<ul> 
  <li>
  	<form action="" method="post" id="form1">
  	<input type="hidden" name="id" value="<?php echo $a['id']; ?>">
    <input type="hidden" name="page" value="<?php echo "page"; ?>">
  	<a href="javascript:;" onClick="document.getElementById('form1').submit(); return false;">Fanpage</a>
    </form>
  </li>
  <li>
    <form action="" method="post" id="form2">
  	<input type="hidden" name="id" value="<?php echo $a['id']; ?>">
    <input type="hidden" name="page" value="<?php echo "gallery"; ?>">
  	<a href="javascript:;" onClick="document.getElementById('form2').submit(); return false;">Photo galery</a>
    </form>
  </li>
  <li>
    <form action="" method="post" id="form3">
  	<input type="hidden" name="id" value="<?php echo $a['id']; ?>">
    <input type="hidden" name="page" value="<?php echo "artical"; ?>">
  	<a href="javascript:;" onClick="document.getElementById('form3').submit(); return false;">Artical</a>
    </form>
  </li>
</ul>

<br /><br />
<br />

Website<br />
<?php echo $a['website']; ?>

<br /><br />
EmailAddress<br /><?php echo $a['email']; ?>


 </div>
   

</div> 
   
   
   


</div>
<script type="text/javascript" src="js/html5.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/jquery.form.js" ></script>
<script type="text/javascript" src="js/tab.js"></script>
<script type="text/javascript" src="js/city.js"></script> 
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "20e8710f-a038-47e3-9f63-a54860ba63e3"});</script>

<?php include("footer.php");  ?>